package com.kum.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kum.domain.dto.SysUserScriptDto;
import com.kum.domain.entity.SysScript;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version V1.0
 * @Package com.kum.mapper
 * @auhter 枯木Kum
 * @date 2021/6/16-10:03 AM
 * <p>...</p>
 */

@Mapper
public interface SysScriptMapper extends BaseMapper<SysScript> {

    /**
     * 获取自己的
     * @return
     */
    @Select("SELECT s.id,s.script_name,s.script_version,s.script_icon,s.script_desc,s.script_match,s.script_require,s.script_retention,s.script_text,s.script_author_id,us.status,s.create_time,s.update_time FROM sys_user_script us LEFT JOIN sys_script s ON us.script_id = s.id  WHERE us.user_id = #{userId}")
    List<SysUserScriptDto> getMyScript(String userId);


}
